/* ===================== 全局重置 ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    /* 现代感字体 */
}

/* ===================== 背景整体调整 ===================== */
body {
    background: linear-gradient(135deg, #2C003E, #4A0072);
    color: #E5DBFF;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===================== 头部区域 ===================== */
header {
    background: rgba(74, 0, 114, 0.9);
    /* 半透明紫色 */
    color: white;
    text-align: center;
    padding: 20px 0;
    font-size: 24px;
    width: 100%;
    position: relative;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

/* ===================== 主体布局 ===================== */
.container {
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* ===================== 可折叠导航栏 ===================== */
nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 100vh;
    background: rgba(74, 0, 114, 0.8);
    padding-top: 60px;
    transition: width 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

nav:hover {
    width: 200px;
    box-shadow: 4px 0px 10px rgba(0, 0, 0, 0.3);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    margin: 10px 0;
    text-align: center;
}

nav ul li a {
    text-decoration: none;
    color: white;
    padding: 15px;
    display: block;
    background: rgba(165, 105, 189, 0.3);
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav:hover ul li a {
    text-align: left;
    padding-left: 20px;
}

nav ul li a:hover {
    background: rgba(165, 105, 189, 0.7);
    transform: translateX(5px);
}


/* ===================== 介绍框（card） ===================== */
.card {
    width: 600px;
    height: 350px;
    display: flex;
    gap: 20px;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.3);
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 介绍框悬浮时放大并增加阴影 */
.card:hover {
    transform: scale(1.05);
    box-shadow: 0px 15px 50px rgba(0, 0, 0, 0.4);
}

/* 头像 */
.card section:first-of-type img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.8);
}

/* 文字部分 */
.card section:last-of-type p:first-of-type {
    color: #D4A5FF;
    font-size: 24px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.card section:last-of-type p:last-of-type {
    font-size: 16px;
    line-height: 1.6;
    color: #E5DBFF;
}

.course-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    /* 元素之间的间距 */
}

.course-name {
    flex-grow: 1;
    text-align: center;
}

.edit-icon,
.delete-icon,
.add-icon {
    cursor: pointer;
    /* 鼠标悬停时显示手型 */
    font-size: 16px;
}

.edit-icon:hover,
.delete-icon:hover,
.add-icon:hover {
    opacity: 0.7;
    /* 悬停时降低透明度，增强交互感 */
}

input[type="text"] {
    width: 100%;
    padding: 5px;
    box-sizing: border-box;
    /* 确保padding不影响宽度 */
}

/* ===================== 页脚区域 ===================== */
footer {
    height: 60px;
    width: 100%;
    background: url("../images/bg.jpeg") no-repeat center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

footer a {
    text-decoration: none;
    color: white;
    font-size: 18px;
    transition: all 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
    transform: scale(1.1);
}

#logout {
    cursor: pointer;
    transition: color 0.3s ease;
}

#logout:hover {
    color: #ff4757 !important;
    text-decoration: underline;
}
/* ===================== 响应式布局调整 ===================== */
@media (max-width: 768px) {

    /* 移动端导航栏样式 */
    nav {
        width: 50px;
        padding-top: 50px;
        background: rgba(74, 0, 114, 0.95);
        z-index: 1000;
        transition: width 0.3s ease, transform 0.3s ease;
    }

    nav:hover {
        width: 200px;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
    }

    /* 导航栏折叠动效 */
    nav ul {
        flex-direction: column;
        justify-content: flex-start;
    }

    nav ul li {
        opacity: 0;
        transition: opacity 0.3s ease 0.2s;
    }

    nav:hover ul li {
        opacity: 1;
    }

    /* 文字渐显效果 */
    nav ul li a {
        white-space: nowrap;
        background: transparent;
        padding: 12px 15px;
        transform: translateX(-10px);
        transition: transform 0.3s ease, background 0.3s ease;
    }

    nav:hover ul li a {
        transform: translateX(0);
    }

    /* 卡片布局优化 */
    .card {
        flex-direction: column;
        width: 85%;
        min-height: 420px;
        margin: 30px 0;
        transform: translateX(30px);
    }

    .container {
        padding-left: 50px;
        justify-content: flex-start;
    }

    /* 头像尺寸调整 */
    .card section:first-of-type img {
        width: 120px;
        height: 120px;
    }

    /* 文字适配 */
    .card section:last-of-type {
        padding: 0 10px;
    }

    .card section:last-of-type p:first-of-type {
        font-size: 20px;
    }

    .card section:last-of-type p:last-of-type {
        font-size: 14px;
    }

    /* Header优化 */
    header {
        font-size: 20px;
        padding: 15px 0;
        z-index: 1001;
    }
}